<?php if(!defined('WANYA_ROOT')) {exit('error!');}?>
<script language="javascript" type="text/javascript" src="editor/My97DatePicker/WdatePicker.js"></script>
<style type="text/css">
	tr {height: 40px}
</style>
<OBJECT id=myColor CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b"
		width="0px" height="0px"></OBJECT>
<div class=containertitle><b>活动管理-<?php echo($action=="add"?"添加":"编辑");?></b>
	<?php if(isset($_GET['active_del'])):?><span class="actived">删除用户成功</span><?php endif;?>
	<?php if(isset($_GET['active_show'])):?><span class="actived">编辑用户资料成功</span><?php endif;?>
</div>
<div class=line></div>
	<form action="activity.php" name="activityform" id="activityform" method="post" enctype="multipart/form-data">
	<table align="center" >
		<tr>
			<td>
				活动名：　　
			</td>
			<td>
				<input type="text" name="activity_name" id="activity_name" value="<?php echo($activity["activity_name"]);?>">
			</td>
			<td colspan="5">

			</td>
		</tr>
		<tr>
			<td>
				活动截止时间：　　
			</td>
			<td>
				<input class="Wdate" type="text" name="activity_deadline" value="<?php echo($activity["activity_deadline"]);?>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})">
			</td>
		</tr>


		<tr>
			<td>
				活动缩略图：　　
			</td>
			<td>
				<input type="file" name="activity_cover" id="activity_cover" value="<?php echo($activity["activity_cover"]);?>">（※图片大小 330px*330px）
			</td>
		</tr>
		<?php if($activity["activity_cover"]){ ?>
		<tr>
			<td>
				 原缩略图：　　
			</td>
			<td>
				<input type="hidden" name="pre_activity_cover" value="<?php echo($activity["activity_cover"]);?>">
				<a href="<?php echo($activity["activity_cover"]);?>" target="_blank"><?php echo($activity["activity_cover"]);?></a>
			</td>
		</tr>
		<?php } ?>

		<tr>
			<td>
				活动海报1：　　
			</td>
			<td>
				<input type="file" name="activity_poster1" id="activity_poster1" value="<?php echo($activity["activity_poster1"]);?>">（※图片大小 960px*Xpx）
			</td>
		</tr>
		<?php if($activity["activity_poster1"]){ ?>
			<tr>
				<td>
					原活动海报1：　　
				</td>
				<td>
					<input type="hidden" name="pre_activity_poster1" value="<?php echo($activity["activity_poster1"]);?>">
					<a href="<?php echo($activity["activity_poster1"]);?>" target="_blank"><?php echo($activity["activity_poster1"]);?></a>
				</td>
			</tr>
		<?php } ?>

		<tr>
			<td>
				活动海报2：　　
			</td>
			<td>
				<input type="file" name="activity_poster2" id="activity_poster2" value="<?php echo($activity["activity_poster2"]);?>">（※图片大小 960px*Xpx）
			</td>
		</tr>
		<?php if($activity["activity_poster2"]){ ?>
			<tr>
				<td>
					原活动海报2：　　
				</td>
				<td>
					<input type="hidden" name="pre_activity_poster2" value="<?php echo($activity["activity_poster2"]);?>">
					<a href="<?php echo($activity["activity_poster2"]);?>" target="_blank"><?php echo($activity["activity_poster2"]);?></a>
				</td>
			</tr>
		<?php } ?>


		<tr>
			<td valign="top">
				活动页面背景色：　　
			</td>
			<td>
				<input type="color" name="activity_bgcolour" id="activity_bgcolour" value="" onchange="$('#activity_bgcolour_show').val($('#activity_bgcolour').val());">
				<input readonly="readonly" id="activity_bgcolour_show" type="text" value="#0b0b0b"/>

				</td>
		</tr>

		<tr>
			<td>
				报名页面头部：　　
			</td>
			<td>
				<input type="file" name="activity_sign_top" id="activity_sign_top" value="<?php echo($activity["activity_sign_top"]);?>">（※图片大小 960px*Xpx）
			</td>
		</tr>
		<?php if($activity["activity_sign_top"]){ ?>
			<tr>
				<td>
					原报名页面头部：　　
				</td>
				<td>
					<input type="hidden" name="pre_activity_sign_top" value="<?php echo($activity["activity_sign_top"]);?>">
					<a href="<?php echo($activity["activity_sign_top"]);?>" target="_blank"><?php echo($activity["activity_sign_top"]);?></a>
				</td>
			</tr>
		<?php } ?>

		<tr>
			<td valign="top">
				报名页面背景色：　　
			</td>
			<td>
				<input type="color" name="activity_sign_bgcolour" id="activity_sign_bgcolour" value="" onchange="$('#activity_sign_bgcolour_show').val($('#activity_sign_bgcolour').val());">
				<input readonly="readonly" id="activity_sign_bgcolour_show" type="text" value="#0b0b0b"/>
				</td>
		</tr>
		<tr>
			<td>
				报名成功1：　　
			</td>
			<td>
				<input type="file" name="activity_sign_suc_poster1" id="activity_sign_suc_poster1" value="<?php echo($activity["activity_sign_suc_poster1"]);?>">（※图片大小 960px*Xpx）
			</td>
		</tr>
		<?php if($activity["activity_sign_suc_poster1"]){ ?>
			<tr>
				<td>
					原报名成功1：　　
				</td>
				<td>
					<input type="hidden" name="pre_activity_sign_suc_poster1" value="<?php echo($activity["activity_sign_suc_poster1"]);?>">
					<a href="<?php echo($activity["activity_sign_suc_poster1"]);?>" target="_blank"><?php echo($activity["activity_sign_suc_poster1"]);?></a>
				</td>
			</tr>
		<?php } ?>

		<tr>
			<td>
				报名成功2：　　
			</td>
			<td>
				<input type="file" name="activity_sign_suc_poster2" id="activity_sign_suc_poster2" value="<?php echo($activity["activity_sign_suc_poster2"]);?>">（※图片大小 960px*Xpx）
			</td>
		</tr>
		<?php if($activity["activity_sign_suc_poster2"]){ ?>
			<tr>
				<td>
					原报名成功2：　　
				</td>
				<td>
					<input type="hidden" name="pre_activity_sign_suc_poster2" value="<?php echo($activity["activity_sign_suc_poster2"]);?>">
					<a href="<?php echo($activity["activity_sign_suc_poster2"]);?>" target="_blank"><?php echo($activity["activity_sign_suc_poster2"]);?></a>
				</td>
			</tr>
		<?php } ?>
		<tr>
			<td colspan="2" align="center">
				<input type="button" name="cancel" value="取消" onclick="formCancel()" class="button">	　　　
				<input type="button" name="confirm" value="确认" onclick="formCheck()" class="button">　　
			</td>
		</tr>
	</table>
		<input type="hidden" name="ID" value="<?php echo($activity["ID"]);?>">
		<input type="hidden" name="action" id="action" value="<?php echo($action);?>">
		<input type="hidden" name="mode" value="commit">　
	</form>
<script type="text/javascript">

	function formCheck()
	{

		if($("#action").val()=="add")
		{
			if($("#activity_name").val()=="")
			{
				alert("请输入活动名称！");
				return;
			}
		}


		$("#activityform").submit();
	}
	function formCancel()
	{
		window.location.href="activity.php";
	}
</script>